<?php
/**
 * Created by PhpStorm.
 * User: Zhanghaiqiang
 * Date: 2019-12-28
 * Time: 14:46
 */

namespace Models\Candy;


use Models\Base\EloquentModel;

class Tech extends EloquentModel
{
    const TABLE_NAME = "candy_tech";
    protected $table = self::TABLE_NAME;
    //媒体类型1文本2横版图片3竖版图片4横版视频5竖版视频6时间
    const MEDIA_TYPE_VALUE_ONLY_TEXT = 1;
    const MEDIA_TYPE_VALUE_W_IMAGE   = 2;
    const MEDIA_TYPE_VALUE_H_IMAGE   = 3;
    const MEDIA_TYPE_VALUE_W_VIDEO   = 4;
    const MEDIA_TYPE_VALUE_H_VIDEO   = 5;
    const MEDIA_TYPE_VALUE_SHOW_TIME = 6;


    public static function getFullTableTable(){
        return config('database.connections.mysql.prefix').self::TABLE_NAME;
    }

    const DB_FIELD_ID          = 'id';
    const DB_FIELD_DATE        = 'date';
    const DB_FIELD_TITLE       = 'title';
    const DB_FIELD_TEXT        = 'text';
    const DB_FIELD_MEDIA_TYPE  = 'media_type';
    const DB_FIELD_MEDIA_SOURCE= 'media_source';
    const DB_FIELD_MEDIA_CONTENT= 'media_content';
    const DB_FIELD_IS_PRIVATE  = 'is_private';
    const DB_FIELD_CREATED_AT  = 'created_at';
    const DB_FIELD_UPDATED_AT  = 'updated_at';
    const DB_FIELD_DELETED_AT  = 'deleted_at';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        self::DB_FIELD_ID,
        self::DB_FIELD_DATE,
        self::DB_FIELD_TITLE,
        self::DB_FIELD_TEXT,
        self::DB_FIELD_IS_PRIVATE,
        self::DB_FIELD_MEDIA_TYPE,
        self::DB_FIELD_MEDIA_SOURCE,
        self::DB_FIELD_MEDIA_CONTENT,
        self::DB_FIELD_CREATED_AT,
        self::DB_FIELD_UPDATED_AT,
        self::DB_FIELD_DELETED_AT,
    ];
}